import Vue from 'vue'
import Router from 'vue-router'
import Index from '@/components/Index'
import Login from '@/components/Login'
import ProductsList from '@/components/Products'
import Admin from '@/components/Admin'
import EditUser from '@/components/EditUser'
import ShowUser from '@/components/ShowUser'
import Miao from '@/components/Miao'
import AdminUser from '@/components/AdminUser'
import AddUser from '@/components/AddUser'
import ReChange from '@/components/ReChange'
import OrderList from '@/components/pages/OrderList'
import EditOrder from '@/components/pages/EditOrder'
import Fee from '@/components/pages/Fee'
import Exchange from '@/components/pages/Exchange'

Vue.use(Router)

export default new Router({
  // mode:'history',
  routes: [
    {
      path: '/',
      name:'Miao',
      component: Miao
    },
    {
      path: '/tags',
      name: 'Index',
      component: Index
    },
    {
      path: '/login',
      name: 'Login',
      component: Login
    },
    {
      path: '/orderlist',
      name: 'OrderList',
      component: OrderList,
    },
    {
      path:'/orderlist/:id',
      component:EditOrder,
      name:'EditOrder'
    },
    {
      path:'/fee',
      component:Fee,
      name:'Fee'
    },
    {
      path:'/exchange',
      component:Exchange,
      name:'Exchange'
    },
    {
      path: '/admin',
      name: 'Admin',
      component: Admin,
      children:[
        {
          path: 'editUser/:user',
          component: EditUser
        },
        {
          path: 'showUser',
          component: ShowUser
        },
        {
          path: 'reChange/:user',
          component: ReChange
        },
        {
          path: 'adminUser',
          component: AdminUser,
          children:[
            {
              path: 'addUser',
              component: AddUser
            },
          ]
        },
      ]
    },
    {
      path: '/products',
      name: 'Products',
      component: ProductsList
    },
  ]
})
